﻿using ApplicationLibrary.SqlConnector;
using System;

namespace Clothes.Masters.ModuleData
{
    #region CL_Titles
    public class CL_Titles : Table
    {
        public static string Name = "CL_Titles";

        public static Column<string> Title = new Column<string>(Name, Properties.Resources.T_Title, "Title", LEN.CODE, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Text", LEN.BIG_DESCRIPTION);

        public override iColumn ForeignKey
        {
            get { return Title; }
        }

        public CL_Titles()
        {
            VisibleInRadar(new iColumn[] { Title, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Title });
        }
    }
    #endregion
    #region CL_Descriptions

    public class CL_Descriptions : Table
    {
        public static string Name = "CL_Descriptions";

        public static Column<DescriptionType> Type = new Column<DescriptionType>(Name, "", "Type", false, false);
        public static Column<int> ID = new Column<int>(Name, "", "ID", false, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Description", LEN.BIG_DESCRIPTION);

        public override iColumn ForeignKey
        {
            get { return ID; }
        }

        public CL_Descriptions()
        {
            VisibleInRadar(new iColumn[] { ID, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { Type, ID });
        }
    }

    #endregion

    #region CL_Masters
    public class CL_Masters : Table
    {
        public static string Name = "CL_Master";

        public static Column<int> ID = new Column<int>(Name, "", "ID", false, false);
        public static Column<string> Description = new Column<string>(Name, Properties.Resources.T_Description, "Text", LEN.BIG_DESCRIPTION);
        public static Column<string> Address = new Column<string>(Name, "", "Address", 128);
        public static Column<string> ZipCode = new Column<string>(Name, "", "ZipCode", 5);
        public static Column<string> City = new Column<string>(Name, "", "City", 35);
        public static Column<string> County = new Column<string>(Name, "", "County", 2);

        public static Column<string> Phone1 = new Column<string>(Name, "", "Phone1", LEN.CODE);
        public static Column<string> Phone2 = new Column<string>(Name, "", "Phone2", LEN.CODE);
        public static Column<string> Fax = new Column<string>(Name, "", "Fax", LEN.CODE);
        public static Column<string> Refer1 = new Column<string>(Name, "", "Refer1", LEN.DESCRIPTION);
        public static Column<string> Refer2 = new Column<string>(Name, "", "Refer2", LEN.DESCRIPTION);
        public static Column<string> Email = new Column<string>(Name, "", "Email", LEN.DESCRIPTION);

        public static Column<DocType> DocType = new Column<DocType>(Name, "", "DocType");
        public static Column<string> DocNo = new Column<string>(Name, "", "DocNo", LEN.LONG_CODE);
        public static Column<string> FiscalCode = new Column<string>(Name, "", "FiscalCode", LEN.CODE);

        public static Column<bool> Blocked = new Column<bool>(Name, "", "Blocked");
        public static Column<bool> Disabled = new Column<bool>(Name, "", "Disabled");
        public static Column<bool> Notify = new Column<bool>(Name, "", "Notify");
        public static Column<bool> WarrantSale = new Column<bool>(Name, "", "WarrantSale");
        public override iColumn ForeignKey
        {
            get { return ID; }
        }

        public CL_Masters()
        {
            VisibleInRadar(new iColumn[] { ID, Description });
            Tablename = Name;
            DefineKey(new iColumn[] { ID });
        }
    } 
    #endregion

}